package com.study.happystudy.mapper;

import com.study.happystudy.po.LeaveNote;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface LeaveNoteMapper {

    void insertLeaveNote(@Param("userId") int userId,
                         @Param("courseId") int courseId,
                         @Param("startTime") String startTime,
                         @Param("endTime") String endTime,String reason);

    LeaveNote getLeaveNoteById(@Param("id") int id);

    void deleteLeaveNoteById(@Param("id") int id);

    List<LeaveNote> getLeaveNotesByCourseId(@Param("courseId") int courseId);

    List<LeaveNote> getFutureLeaveNotesByCourseIdAndStatus(@Param("courseId") int courseId,
                                                           @Param("approved") String approved);

    List<LeaveNote> getPastLeaveNotesByCourseIdAndStatus(@Param("courseId") int courseId,
                                                         @Param("approved") String approved);

    List<LeaveNote> getFutureLeaveNotesByCourseId(@Param("courseId") int courseId);

    List<LeaveNote> getPastLeaveNotesByCourseId(@Param("courseId") int courseId);

    List<LeaveNote> getLeaveNotesByCourseIdAndStatus(@Param("courseId") int courseId,@Param("approved")String approved);
    void updateLeaveNote(@Param("approved") String approved,@Param("id") int id);
}
